module.exports = (app) => {
    const { router, controller } = app;
    // 根路由首页
    router.get('/', controller.home.index);

    // 登录注册
    router.post('/login', controller.home.login);
    router.post('/register', controller.home.register);

    // 用户相关接口
    router.post('/users', controller.user.create);
    router.get('/users', controller.user.index);
    router.put('/users/:id', controller.user.update);
    router.delete('/users/:id', controller.user.destroy);
};
